//
//@File    :	4.9_strtype3.cpp
//@Time    :	2021/08/03 17:23:06
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	more string class features
//

#include <iostream>
#include <cstring>
#include <string>

int main()
{
    using namespace std;
    char charr1[20];
    char charr2[20] = "jaguar";
    string str1;
    string str2 = "panther";

    str1 = str2;
    strcpy(charr1,charr2);

    str1 +=" paste";
    strcat(charr2," juice");

    int len1 = str1.size();
    int len2 = strlen(charr1);

    cout<<"The string "<<str1<<" contains"
        <<len1<<" characters.\n";
    cout<<"The string "<<charr1<<" contains"
        <<len2<<" characters.\n";
    system("pause");
    return 0;
}